package com.demo.auth.entity.qo;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

import javax.validation.constraints.AssertTrue;
import javax.validation.constraints.NotBlank;

@Slf4j
@Data
public class AuthCodeQo {

    @NotBlank(message = "不能为空")
    private String responseType;
    private String userName;

    @AssertTrue(message = "response type值不支持")
    private boolean isValid() {
        log.info("responseType值：" + responseType);
        return StringUtils.equals(responseType, "code");
    }
}
